<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:replace="${title}"></title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/typo.css" th:href="@{/css/typo.css}">
    <link rel="stylesheet" href="../static/css/animate.css" th:href="@{/css/animate.css}">
    <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/lib/prism/prism.css}">
    <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/lib/tocbot/tocbot.css}">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
</head>
<body>
<!--导航-->
<nav th:fragment="menu(n)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <a href="#"><h2 class="ui teal header item" th:text="${session.topTitle}">Cenの风尘客栈</h2></a>
            <a href="#" th:href="@{/}" class="m-item item m-mobile-hide " th:classappend="${n==1} ? 'active'"><i
                    class="star icon"></i>首页</a>
            <a href="#" th:href="@{/types/-1}" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i
                    class=" list icon"></i>分类</a>
            <a href="#" th:href="@{/tags/-1}" class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'"><i
                    class=" tags icon"></i>标签</a>
            <a href="#" th:href="@{/archives}" class="m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'"><i
                    class=" calendar alternate outline icon"></i>时间轴</a>
            <a href="#" th:href="@{/picture}" class="m-item item m-mobile-hide" th:classappend="${n==5} ? 'active'"><i
                    class="heart icon"></i>照片墙</a>
            <a href="#" th:href="@{/about}" class="m-item item m-mobile-hide" th:classappend="${n==6} ? 'active'"><i
                    class="smile outline icon"></i>关于Cen</a>
            <!--<div class="right m-item item m-mobile-hide">
                <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                    <div class="ui icon inverted transparent input m-margin-tb-tiny">
                        <input type="text" name="query" placeholder="搜索...." th:value="${query}">
                        <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                    </div>
                </form>
            </div>-->
        </div>
    </div>
</nav>

<!--底部-->
<footer th:fragment="footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned container">
        <h3 class="item">小栈浏览量 : <span th:text="${session.views}" class="item m-text-thin"></span></h3>
        <h3 class="item">&nbsp;&nbsp;&nbsp;小栈已持续运行时间:<span id="htmer_time" class="item m-text-thin"></span> &nbsp;&nbsp;&nbsp;
        </h3>
        <br><br>
        <div class="ui inverted divided stackable grid">
            <!--微信二维码
            <div class="four wide column">
                <div class="ui inverted link list">
                    <a class="item" href="#"><img th:src="@{/images/wechat.png}" title="可以加我交流~"  class="ui rounded image" alt="哎呀 微信二维码摸鱼去啦" style="width: 110px"></a>
                </div>
            </div>
            -->
            <!--推荐博客-->
            <div class="five wide column">
                <h4 class="ui inverted header me-opacity-mini">小栈文章</h4>
                <div id="newblog-container">
                    <div class="ui inverted link list" th:fragment="newblogList">
                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="item m-text-thin"
                           th:each="blog : ${newblogs}" th:text="${blog.title}"></a>
                    </div>
                </div>
            </div>
            <!--联系作者-->
            <div class="five wide column">
                <h4 class="ui inverted header me-opacity-mini">如何call我？</h4>
                <div class="ui inverted list link">
                    <p class="item">邮箱: 1249280779@qq.com</p>
                    <p class="item">QQ: 1249280779</p>
                    <p class="item">wechat: Ashely_cenxifan</p>
                    <a target="_blank" href="https://blog.csdn.net/cCENDD?spm=1000.2115.3001.5343" class="item">CSDN</a>
                </div>
            </div>
            <!--个人说明-->
            <div class="five wide column">
                <h4 class="ui inverted header me-opacity-mini">碎碎念~</h4>
                <div class="ui inverted list link">
                    <p class="item">世事繁杂</p>
                    <p class="item">我想和你</p>
                    <p class="item">过安稳的生活</p>
                </div>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <div class="ui inverted list link">
            <p class="item">Copyright© 2022 Cen Designed by Cen_L_H</p>
            <p class="item"></p>
            <a class="item" target="_blank" href='https://beian.miit.gov.cn' style="color: #FF0066">粤ICP备2022008904号</a>
            <a class="item" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44172302000104" style="color: red;margin-top: 5px">
                <img th:src="@{images/1.png}" src="../static/images/1.png" align="center"/>粤公网安备 44172302000104号
            </a>
        </div>
    </div>
</footer>


<!--Live-2D看板娘模型-->
<script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script>

<!--Live-2D看板娘模型-->
<script type="text/javascript">
    //Live-2D看板娘模型
    L2Dwidget.init({
        model: {
            //jsonpath控制显示那个小萝莉模型，下面这个就是我觉得最可爱的小萝莉模型 //hijiki  //izumi //shizuku //koharu
            jsonPath: "https://unpkg.com/live2d-widget-model-koharu@1.0.5/assets/koharu.model.json", //这里改模型，前面后面都要改
            scale: 1,
        },
        display: {
            position: "left", //设置看板娘的上下左右位置
            width: 120,  //小萝莉的宽度
            height: 200, //小萝莉的高度
            hOffset: 65,  //水平偏移
            vOffset: -205  //垂直偏移
        },
        mobile: {
            show: false,  //在移动端不显示
            scale: 0.4    //移动设备上的缩放
        },
        react: {
            opacityDefault: 0.9, //设置透明度
            opacityOnHover: 0.2
        },
    });
</script>

<th:block th:fragment="script">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
    <script src="../static/lib/prism/prism.js" th:src="@{/lib/prism/prism.js}"></script>
    <script src="../static/lib/tocbot/tocbot.min.js" th:src="@{/lib/tocbot/tocbot.min.js}"></script>
    <script src="../static/lib/qrcode/qrcode.min.js" th:src="@{/lib/qrcode/qrcode.min.js}"></script>
    <script src="../static/lib/waypoints/jquery.waypoints.min.js"
            th:src="@{/lib/waypoints/jquery.waypoints.min.js}"></script>
    <script>
        $('#newblog-container').load(/*[[@{/footer/newblog}]]*/"/footer/newblog");


        // 运行时间统计
        function secondToDate(second) {
            if (!second) {
                return 0;
            }
            var time = new Array(0, 0, 0, 0, 0);
            if (second >= 365 * 24 * 3600) {
                time[0] = parseInt(second / (365 * 24 * 3600));
                second %= 365 * 24 * 3600;
            }
            if (second >= 24 * 3600) {
                time[1] = parseInt(second / (24 * 3600));
                second %= 24 * 3600;
            }
            if (second >= 3600) {
                time[2] = parseInt(second / 3600);
                second %= 3600;
            }
            if (second >= 60) {
                time[3] = parseInt(second / 60);
                second %= 60;
            }
            if (second > 0) {
                time[4] = second;
            }
            return time;
        }

        function setTime() {
            /*此处为网站的创建时间*/
            var create_time = Math.round(new Date(Date.UTC(2021, 12, 9, 15, 15, 15)).getTime() / 1000);
            var timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
            currentTime = secondToDate((timestamp - create_time));
            currentTimeHtml = currentTime[0] + '年' + currentTime[1] + '天'
                + currentTime[2] + '时' + currentTime[3] + '分' + currentTime[4]
                + '秒';
            document.getElementById("htmer_time").innerHTML = currentTimeHtml;
        }

        setInterval(setTime, 1000);

    </script>
</th:block>

<!--鼠标点击效果-->
<script type="text/javascript">
    var a_idx = 0;
    jQuery(document).ready(function ($) {
        $("body").click(function (e) {
            var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善", "社会主义好", "永远跟党走", "First Blood", "Double Kill", "Triple Kill", "Quadra Kill"
                , "Penta Kill");
            var $i = $("<span/>").text(a[a_idx]);
            a_idx = (a_idx + 1) % a.length;
            var x = e.pageX, y = e.pageY;
            $i.css({
                "z-index": 100000000,
                "top": y - 20,
                "left": x,
                "position": "absolute",
                "font-weight": "bold",
                "color": "#ef5b40"
            });
            $("body").append($i);
            $i.animate({"top": y - 180, "opacity": 0}, 1500, function () {
                $i.remove();
            });
        });
    });
</script>

</body>
</html>